package com.example.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import feign.Feign;
import feign.Logger;
import feign.auth.BasicAuthRequestInterceptor;

/**
 * 自定义feign的配置
 * @author peixinxu
 *
 */
@Configuration
public class FeignConfiguration2 {
	@Bean
    public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
        return new BasicAuthRequestInterceptor("user", "123456");
    }
	@Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }

	/**
	 * 取消关联hystrix
	 * @return
	 */
	@Bean
	@Scope("prototype")
	public Feign.Builder feignBuilder() {
		return Feign.builder();
	}
}
